vec3 ComputeObjectPosition()
{
  mat4 viewMatrix = vGetWorldViewMatrix();
  vec4 originAndLengthInMM = vGetFixedSizeOriginAndLengthInMM(); // cb_FixedSize.u_FixedSizeOrigin;
  // originAndLengthInMM.xyz : origin   ;   originAndLengthInMM.w : lengthInMM
  float scaleFactor = cb_FixedSize.u_FixedSizeScaleFactor * originAndLengthInMM.w;
  if(cb_FixedSize.u_FixedSizeOrthographicProjectionScaleFactor != 0.f) // if we are in orthographic projection
    scaleFactor *= cb_FixedSize.u_FixedSizeOrthographicProjectionScaleFactor; 
  else // perspective projection
    scaleFactor *= -( // Minus because the camera looks into the direction -z 
      viewMatrix[0][2] * originAndLengthInMM.x + 
      viewMatrix[1][2] * originAndLengthInMM.y + 
      viewMatrix[2][2] * originAndLengthInMM.z + 
	  viewMatrix[3][2]); // z coordinate of origin in view space, which is used as the view-dependent part of the scaling factor.
  return scaleFactor * vGetAttribPosition() + (1.0 - scaleFactor) * originAndLengthInMM.xyz; // s*p + (1-s)*o = o + s*(p-o)
}
